<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Dashboard extends MY_Controller {

	function __construct(){
		parent::__construct();
		
		if(!$this->checkUserStatus()){
			redirect('login');
		}else{
			$this->aauth->update_activity();
		}
		
	}
	public function index()
	{
		$data['toDoList'] = $this->get_tasks();
		$data['title'] = $this->title('Tableau de bord');
		$data['user'] = $this->aauth->get_user();
		$data['customer_count'] = customer::find_num_rows();
		$data['property_count'] = property::find_num_rows();
		$data['user_count'] = aauth_user::find_num_rows();
		$data['task_count'] = follow::find_num_rows($this->aauth->get_user_id());
		$data['photo_count'] = gallery::find_num_rows();
		$data['photos'] = gallery::find('all', array('limit'=>5,'order'=>'id desc'));
		$data['propertyPreview'] = property::find('all',array('limit'=>5,'order'=>'date_create desc'));
		$this->load->view($this->theme.'/header',$data);
		$this->load->view($this->theme.'/dashboard');
		$this->load->view($this->theme.'/footer');
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */